﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAOAuction;
using DTOAuction;

namespace BUSAuction
{
    public class BUSLop
    {
        public int themLopMoi(int maHPMo)
        {
            DAOLop DAOLop = new DAOLop();
            return DAOLop.themLopMoi(maHPMo);
        }

        public List<LOP_getallwithMaKhoaResult> layDanhSachLopTheoMaKhoa(int maKhoa)
        {
            DAOLop lop = new DAOLop();
            return lop.layDanhSachLopTheoMaKhoa(maKhoa);
        }
        public int update_PhanCongGiaoVien(int maLop, int maGiaoVien)
        {
            DAOLop lop = new DAOLop();
            return lop.update_PhanCongGiaoVien(maLop, maGiaoVien);
        }
        public int update_sapxepThoiKhoaBieu(int maLop, string ngay, int bd, int kt)
        {
            DAOLop lop = new DAOLop();
            return lop.update_sapxepThoiKhoaBieu(maLop, ngay, bd, kt);
        }

        public List<LOP_LayDanhSachLopHocChuaCoPhongResult> LayDanhSachLopChuaCoPhong()
        {
            DAOLop DAOLop = new DAOLop();
            return DAOLop.layDanhSachLopChuaCoPhong();
        }

        public int capNhatPhongVaoLopHoc(int maLop, int maPhong)
        {
            DAOLop DAOLop = new DAOLop();
            return DAOLop.capNhatPhongVaoLopHoc(maLop, maPhong);
        }

        public List<LOP_getallResult> layDanhSachTatCaCacLopDuocMo()
        {
            DAOLop DAOLop = new DAOLop();
            return DAOLop.layDanhSachTatCaCacLopDuocMo();
        }

		/// <summary>
		/// author: hqlam
		/// </summary>
		public bool kiemTraThongTinLopHoc(int maLop)
		{
			// kiem tra lop hoc ton tai
	        DAOLop DAOLop = new DAOLop();
			LOP lop = DAOLop.layThongTinLop(maLop);

			// kiem tra lop con co the dang ky
			// database khong dap ung duoc yeu cau, bo qua
			return true;
		}

		/// <summary>
		/// author: hqlam
		/// </summary>
		public bool capNhatThongTinLopHoc(LOP lopHoc)
		{
			// cap nhat si so lop hoc
			DAOLop DAOLop = new DAOLop();
			return DAOLop.capNhatThongTinLopHoc(lopHoc);
		}

		/// <summary>
		/// author: hqlam
		/// </summary>
		public static LOP layThongTinLop(int maLop)
		{
			return DAOLop.layThongTinLop(maLop);
		}
    }
}
